package com.chuangjiangx.member.manager.web.web.basic.request;

import com.chuangjiangx.commons.DateUtils;
import com.chuangjiangx.commons.request.PageRequest;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
public class MemberListRequest extends PageRequest {

    /**
     * 会员名或手机号
     */
    private String nameOrMobile;

    /**
     * 性别
     */
    private Byte sex;

    /**
     * 门店名字
     */
    private String storeName;

    /**
     * 开始注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT + 8")
    private Date startRegisterTime;

    /**
     * 结束注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT + 8")
    private Date endRegisterTime;


    public void setEndRegisterTime(Date endRegisterTime) {
        this.endRegisterTime = endRegisterTime;
        if (endRegisterTime != null) {
            this.endRegisterTime = DateUtils.getEndTime(endRegisterTime);
        }
    }
}
